//
//  WeakScriptMessageDelegate.h
//  webDemo
//
//  Created by thomasho on 2017/9/12.
//  Copyright © 2017年 thomasho. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <WebKit/WebKit.h>

@interface WeakScriptMessageDelegate : NSObject<WKScriptMessageHandler>


@property (nonatomic, weak) id<WKScriptMessageHandler> scriptDelegate;

//将 handler 转换成一个弱引用的 scriptDelegate,从而避免内存泄漏
- (instancetype)initWithDelegate:(id<WKScriptMessageHandler>)scriptDelegate;

@end
